function ccR_Rogue_2()
	if ccrPlayerLevel() >= 10 and ccrPlayerLevel() <= 89 then ccR_Rogue_Combat_10_89() end
end

function ccR_Rogue_Combat_10_89()

	ccR_Rogue_AutoStealth()

	if ccrPlayerIsInStealth() then
		-- Stealth

		ccR_Rogue_Shadowstep()
		ccR_Rogue_Distract()

		if (
				ccrPlayerIsBehindTarget()
				or
				ccrPlayerHasTalent(CLOAK_AND_DAGGER)
			)
		and SpellCanAttack(AMBUSH)
		then
			ccrCastAttack(AMBUSH)
			return
		end

		if (
				not ccrPlayerIsBehindTarget()
				or
				ccrPlayerHasTalent(CLOAK_AND_DAGGER)
			)
		and ccrPlayerHasSpell(CHEAP_SHOT)
		and SpellCanAttack(CHEAP_SHOT)
		and not ccrTargetIsBoss()
		then
			ccrCastAttack(CHEAP_SHOT)
			return
		end
	else
		-- No Stealth

		-- Abilities
		if ccrPlayerIsInCombat() then
			ccR_Rogue_Evasion()
			ccR_Rogue_Blade_Flurry()
			ccR_Rogue_Kick()
			ccR_Rogue_Gouge()
			ccR_Rogue_KeepBuffsUp()
			ccR_Rogue_Adrenaline_Rush()
			ccR_Rogue_Elusiveness()
			ccR_Rogue_Dismantle()
			ccR_Rogue_Cloak_of_Shadows()
			ccR_Rogue_Killing_Spree()
			ccR_Rogue_Shadow_Blades()
		end

		if ccrPlayerHasSpell(FAN_OF_KNIVES)
		and ccrPlayerHasSpell(CRIMSON_TEMPEST)
		then	
			local vCount = ccrPlayerCount(10)
			-- Single Target Rotation
			if (ccRS.Auto_AoE and (vCount >= 1 and vCount <= ccRS.Rogue_2_SingleTargetCount))
			or (ccrTargetIsBoss() and ccRS.Auto_AoE_Ignore_On_Boss)
			or (not ccRS.Auto_AoE and not ccRS.Manual_AoE)
			then
				-- Revealing Strike
				if ccrPlayerHasSpell(REVEALING_STRIKE)
				and not ccrTargetHasDebuff(REVEALING_STRIKE)
				and SpellCanAttack(REVEALING_STRIKE)
				then
					ccrCastAttack(REVEALING_STRIKE)
					return
				else
					if ccrPlayerHasSpell(SLICE_AND_DICE)
					and not ccrPlayerHasBuff(SLICE_AND_DICE)
					then
						ccR_Rogue_Slice_And_Dice()
					else
						if ccrTargetIsBoss()
						and ccrPlayerHasSpell(RUPTURE)
						and not ccrTargetHasDebuff(RUPTURE)
						then
							ccR_Rogue_Rupture()
						else
							ccR_Rogue_Eviscerate()
						end
					end
				end
			return
			end
			-- AoE Rotation
			if (ccRS.Auto_AoE and vCount >= ccRS.Rogue_2_AoECount)
			or (not ccRS.Auto_AoE and ccRS.Manual_AoE)
			then
				-- Crimson Tempest
				if (ccrPlayerComboPoints() >= 4 or (ccrPlayerComboPoints() > 0 and ccrTargetHealth() <= 20))
				and SpellIsReady(CRIMSON_TEMPEST)
				then
					ccrCast(CRIMSON_TEMPEST)
					return
				end

				-- Fan of Knives
				if ccrPlayerComboPoints() <= 3 then
					ccR_Rogue_Build_Combo_Point()
					return
				end
			end
		else
			-- No real AoE
			
			-- Revealing Strike
			if ccrPlayerHasSpell(REVEALING_STRIKE)
			and not ccrTargetHasDebuff(REVEALING_STRIKE)
			and SpellCanAttack(REVEALING_STRIKE)
			then
				ccrCastAttack(REVEALING_STRIKE)
				return
			else
				if ccrPlayerHasSpell(SLICE_AND_DICE)
				and not ccrPlayerHasBuff(SLICE_AND_DICE)
				then
					ccR_Rogue_Slice_And_Dice()
				else
					if ccrTargetIsBoss()
					and ccrPlayerHasSpell(RUPTURE)
					and not ccrTargetHasDebuff(RUPTURE)
					then
						ccR_Rogue_Rupture()
					else
						ccR_Rogue_Eviscerate()
					end
				end
			end

		end
	end
end